﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports MySql.Data.MySqlClient

Public Class TipoDocumentosFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As TipoDocumentosBE
        Dim tmpTipoDocumentos As TipoDocumentosBE = New TipoDocumentosBE()
        Try
            With tmpTipoDocumentos
                '.IdtipoDoctos = convertDTFromDb.convertInt32(dr.Item("IdtipoDoctos"))
                .UsaFactura = convertDTFromDb.ConvertBoolean(dr.Item("UsaFA"))
                .RegimenFiscalFactura = convertDTFromDb.ConvertString(dr.Item("RegFA"))
                .UsaCartaPorte = convertDTFromDb.ConvertBoolean(dr.Item("UsaCP"))
                .RegimenFiscalCartaPorte = convertDTFromDb.ConvertString(dr.Item("RegCP"))
                .UsaReciboHonorarios = convertDTFromDb.ConvertBoolean(dr.Item("UsaRH"))
                .RegimenFiscalReciboHonorarios = convertDTFromDb.ConvertString(dr.Item("RegRH"))
                .UsaReciboArrendamiento = convertDTFromDb.ConvertBoolean(dr.Item("UsaRA"))
                .RegimenFiscalReciboArrendamiento = convertDTFromDb.ConvertString(dr.Item("RegRA"))
                .UsaNotaCargo = convertDTFromDb.ConvertBoolean(dr.Item("UsaNA"))
                .RegimenFiscalNotaCargo = convertDTFromDb.ConvertString(dr.Item("RegNA"))
                .UsaNotaCredito = convertDTFromDb.ConvertBoolean(dr.Item("UsaNC"))
                .RegimenFiscalNotaCredito = convertDTFromDb.ConvertString(dr.Item("RegNC"))
                .UsaComprobantePagoPlazos = convertDTFromDb.ConvertBoolean(dr.Item("UsaCOP"))
                .RegimenFiscalComprobantePagoPlazos = convertDTFromDb.ConvertString(dr.Item("RegCOP"))
                .UsaReciboDonativos = convertDTFromDb.ConvertBoolean(dr.Item("UsaRD"))
                .RegimenFiscalReciboDonativos = convertDTFromDb.ConvertString(dr.Item("RegRD"))
            End With
            Return tmpTipoDocumentos
        Catch ex As Exception
            Throw
        Finally
            tmpTipoDocumentos = Nothing
        End Try
    End Function
End Class
